//
//  BHMeRowTableViewCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/11.
//

import UIKit

class BHMeRowTableViewCell: UITableViewCell {

    @IBOutlet weak var content_backView: UIView!
    @IBOutlet weak var iconImgView: UIImageView!
    
    @IBOutlet weak var name_label: UILabel!
    
    @IBOutlet weak var detail_label: UILabel!
    @IBOutlet weak var line: UILabel!
    
    var model: BHMeGroupItemModel! {
        didSet {
            self.iconImgView.image = UIImage.init(named: model.iconName)
            self.name_label.text = model.itemName
        }
    }
     
    // 0 表示第一个，切上部， 1表示中间，不切  2表示最后一个，切下部
    var type: Int = 1 {
        didSet {
            if type == 0 {
                self.content_backView.addCorner(conrners: [.topLeft,.topRight], radius: 8)
            }else if self.type == 2 {
                self.content_backView.addCorner(conrners: [.bottomLeft,.bottomRight], radius: 8)
            }else {
                self.content_backView.addCorner(conrners: .allCorners, radius: 0)
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
